<!-- 查询 content -->
{{ $contentSQL := "* FROM content WHERE id=? and status<3 order by status desc, sortNo desc" }}

{{ if eq .userType 1}}
  {{ $contentSQL ="* FROM content WHERE id=? order by sortNo desc" }}
{{end}}

{{ $content := selectOne "content" $contentSQL .UrlPathParam }}

{{ $prevContent := selectOne "content"  "id,title FROM content WHERE status in (1,2) and sortNo < ? order by sortNo desc " $content.SortNo  }}
{{ $nextContent := selectOne "content"  "id,title FROM content WHERE status in (1,2) and sortNo > ? order by sortNo asc " $content.SortNo  }}

<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <title>{{ $content.Title }}</title>
  <meta name="description" content="{{ $content.Description }}" />
  <meta name="keyword" content="{{ $content.Keyword }}" />

  {{template "bodystart.html" $content }}

<div class="gdoc-page">

  <article class="gdoc-markdown gdoc-markdown__align--left">
      <h1>ToC</h1>
      <p>{{  safeHTML $content.Summary }}</p>

      <div class="gdoc-toc gdoc-toc__level--3">
        <nav id="TableOfContents">
            {{  safeHTML $content.Toc }}
        </nav>
    </div>



    {{ safeHTML $content.Content }}

     
   </article>
  <div class="gdoc-page__footer flex flex-wrap justify-between">
      {{if $prevContent.Id }}
      <span class="gdoc-page__nav">
          <a class="gdoc-page__nav--prev flex align-center" href="{{basePath}}{{ trimPrefixSlash $prevContent.Id}}" title="{{$prevContent.Title}}">
              <i class="gdoc-icon">gdoc_arrow_left_alt</i>{{$prevContent.Title}}
          </a>
      </span>
      {{end}}
      {{if $nextContent.Id }}
      <span class="gdoc-page__nav">
          <a class="gdoc-page__nav--next flex align-center" href="{{basePath}}{{ trimPrefixSlash $nextContent.Id}}" title="{{$nextContent.Title}}">{{$nextContent.Title}}<i class="gdoc-icon">gdoc_arrow_right_alt</i>
          </a>
      </span>
      {{end}}
  </div>
</div>

    <script src="{{basePath}}js/search-9719be99.bundle.min.js"></script>
{{template "bodyend.html" }}           